What is a Function Call?
A function call is where the function is invoked in the program, typically from the main() function or another function.
The arguments passed during the call are sent to the function as its parameters.
Syntax
function_name(argument1, argument2, ...);
Example
int addNumbers(int a, int b) {
return a + b;
}
int main() {
int sum = addNumbers(5, 3); // Function call
printf("Sum: %d\n", sum);
return 0;
}
Category of Functions
There are generally two categories of functions in C:
- Standard Library Functions: Functions provided by C libraries (e.g.,
printf,scanf,strlen, etc.). - User-Defined Functions: Functions defined by the programmer for specific tasks.